package com.code.Factorial;

/**
 * Username : YouQiRong
 * Date : 2025/5/19 19:22
 * Class: 递归反向打印字符串
 */
public class ReversePrintString {
    public static void f(int n, String str){
        if (n ==  str.length()){
            return;
        }

        f(n+1,str);
        System.out.println(str.charAt(n));

    }

    public static void main(String[] args) {
        f(0,"ABCD"); //输出 DCBA
    }
}
